//function toHref(url){
//	location.href=base.app+url;
//}



var form = layui.form; 
var $ = layui.jquery;
var layer = layui.layer;
var laytpl = layui.laytpl;
var laypage = layui.laypage;
var upload = layui.upload;
function formSubmit(event,url,dataType,func){
	form.on("submit("+event+")",function(data){
		ajax(url,data.field,dataType,func)
	})
}
function ajax(url,field,dataType,func){ 
	$.ajax({
		 url:base.app+url,
		 data:field,
		 type:"post",
		 dataType:dataType,
		 success:func
	});
}

function layerConfirm(func,title){
	layer.confirm(title?title:"确定进行该操作？",{
		icon:3,
		title:"提示"
	},func)
}

function layerOpen(url,end){
layer.open({
	type:2,
	content:base.app+url,
	area:['750px','500px'],
	fixed:false,
	maxmin:true,
	shade:0.8,
	closeBtn:2,
	shadeClose:true,
	  
	end:function(){
		
	},
})	
}

function layerClose(){
	var index = parent.layer.getFrameIndex(window.name);//先得到当前iframe层的索引
	parent.layer.close(index);//再执行关闭
}


function pageInfo(elem,count,curr,limit,jump){
	laypage.render({
		elem:elem,
		count:count,
		curr:curr,
		limit:limit,
		limits:[10,20,30,40,50],
		layout:['count','prev','page','next','limit','refresh','skip'],
		jump:jump
	})
}

function renderUpload(id,url,data,done){//将按钮渲染成可进行上传操作的按钮
	var uploadInst = upload.render({//类似ajax
		elem:'#'+id,//绑定元素
		url:base.app+url,//上传接口
		data:data,//非文件域参数（上传过程中额外的参数）
		done:done,//上传完毕回调 类似success	
	});
}














